|
Cytosim
PI
Cytoskeleton Simulator
|
This PointSet describes a thin flexible Fiber that is longitudinally incompressible. The length of the FiberNaked can be changed by growP(), growM(), cutP() and cutM().
The best number of points to describe a FiberNaked is automatically calculated: It is the integer nb_points that minimizes:
where segmentation is a parameter of the fiber class. All the segments in a fiber all have the same length
Note that FiberNaked::segmentation() is not always equal to FiberProp::segmentation. If the fibers have various length, their segmentation() will be different, even though they all share the same value of FiberProp::segmentation.
See related functions: length(), nbPoints() and segmentation().
Successive model-points are kept at a constant distance via constrained dynamics:
An abscissa is a curvilinear distance taken along the Fiber, and the FiberNaked provides an origin to make this independent of the model-points. Thus even if the fiber lengthen from its ends, a position described by an abscissa will stay associated with the same local lattice site.
Functions are provided in FiberNaked to convert abscissa measured from different references, and to obtain positions of the fiber for a given abcissa.
The class FiberBinder keeps track of its position using an abscissa from the origin, and all Hand objects are built from this class. The class Fiber keeps track of the FiberBinder that are attached to itself.
Public Member Functions | |
| FiberNaked () | |
| Constructor. | |
| ~FiberNaked () | |
| Destructor. | |
| void | setStraight (Vector const &pos, Vector const &dir) |
| set position of MINUS_END and direction (length and Nb of points are not modified) More... | |
| void | setStraight (Vector const &pos, Vector const &dir, FiberEnd ref) |
| set position of 'ref' and direction of Fiber | |
| void | setStraight (Vector const &pos, Vector const &dir, real len, FiberEnd ref) |
| set position of 'ref', direction and length of Fiber | |
| void | setShape (const real pts[], unsigned n_pts, unsigned np) |
| import shape from the given array of size DIM*n_pts, and create a shape with np points More... | |
| PointExact | exactEnd (FiberEnd) const |
| exact representation of given end | |
| PointInterpolated | interpolateEnd (FiberEnd) const |
| interpolation representing a given end (CENTER is also a valid argument) | |
| PointInterpolated | interpolateCenter () const |
| interpolation representing a given end | |
| PointInterpolated | interpolateMinusEnd () const |
| interpolation representing the MINUS_END | |
| PointInterpolated | interpolatePlusEnd () const |
| interpolation representing the PLUS_END | |
| PointInterpolated | interpolate (real ab) const |
| interpolation of the site specified by its distance from the ORIGIN More... | |
| PointInterpolated | interpolateM (real ab) const |
| interpolation of the site specified from the MINUS_END More... | |
| PointInterpolated | interpolate (real ab, FiberEnd from) const |
| interpolation of a site specified by its distance from a FiberEnd | |
| real | abscissaM () const |
| signed distance from ORIGIN to MINUS_END (abscissa of MINUS_END) | |
| real | abscissaP () const |
| signed distance from ORIGIN to PLUS_END (abscissa of PLUS_END) | |
| real | abscissaP (const real n) const |
| signed distance from ORIGIN to given point or intermediate position | |
| real | abscissa (FiberEnd end) const |
| signed distance from the ORIGIN to the specified FiberEnd More... | |
| real | abscissa (real ab, FiberEnd from) const |
| converts abscissa from the specified FiberEnd, to abscissa from the ORIGIN More... | |
| real | length () const |
| the total length of the Fiber | |
| bool | within (const real ab) const |
| true if ( abscissaM() < ab < abscissaP() ) | |
| bool | withinP (const real ab) const |
| true if abscissa is below abscissaP | |
| bool | withinM (const real ab) const |
| true if abscissa is above abscissaM | |
| unsigned int | signature () const |
| a random number which is used in speckle display | |
| void | signature (unsigned int s) |
| set signature | |
| FiberEnd | whichEndDomain (real ab, real lambda) const |
| calculate the domain in which ab is located (near a FiberEnd, or central) More... | |
| Vector | pos (real ab) const |
| position of a point specified by abscissa from the origin | |
| Vector | posM (real ab) const |
| position of a point specified by abscissa from the MINUS_END | |
| Vector | pos (real ab, FiberEnd from) const |
| position of a point specified by abscissa on the Fiber | |
| Vector | posEnd (FiberEnd which) const |
| position of a FiberEnd (CENTER is also a valid argument) | |
| Vector | dirP (unsigned p) const |
| normalized tangent vector to the fiber at given model point More... | |
| Vector | dir (real ab) const |
| normalized tangent vector to the fiber at given abscissa from the origin | |
| Vector | dir (real ab, FiberEnd from) const |
| normalized tangent vector to the fiber at given abscissa from given reference | |
| Vector | dirEnd (FiberEnd which) const |
| normalized tangent vector to the fiber at given end | |
| real | projectedForceOnEnd (FiberEnd which) const |
| dot-product (force/km on the end of the Fiber).(direction of Fiber growth) More... | |
| void | segmentation (real c) |
| set desired segmentation (the actual segmentation might be different) | |
| real | segmentation () const |
| the current segment length (distance between successive model-points) | |
| real | segmentationCub () const |
| returns segmentation() ^ 3 | |
| void | resegment (unsigned int nb_points) |
| recalculate fiber to have nb_points model points More... | |
| void | adjustSegmentation () |
| set the number of points to minimize abs( fnCut - fnCutWished ) More... | |
| void | reshape () |
| re-establish the distance between successive model-points | |
| void | getPoints (const real *x) |
| set position | |
| void | minMaxSegments (real &, real &) const |
| calculate the minimum and maximum segment length More... | |
| void | infoSegments (real &, real &) const |
| calculate average and variance of the segment length More... | |
| real | minCosinus () const |
| the cosine of the maximum segment angle: indicate the errors due to curvature | |
| unsigned | nbKinks (real threshold=0) const |
| number of joints at which ( cosine(angle) < threshold ) More... | |
| void | join (FiberNaked const *fib) |
| merge two fibers by joining the PLUS_END of fib with the MINUS_END of this More... | |
| void | growM (real dlen) |
| increase/decrease length of Fiber by dlen, at the MINUS_END More... | |
| void | addSegmentM () |
| add a segment of length segmentation() at the MINUS_END More... | |
| void | cutM (real dlen) |
| remove a piece of length dlen >= 0 at the MINUS_END More... | |
| void | growP (real dlen) |
| increase/decrease length of Fiber by dlen, at the PLUS_END More... | |
| void | addSegmentP () |
| add a segment of length segmentation() at the MINUS_END More... | |
| void | cutP (real dlen) |
| remove a piece of length dlen >= 0 at the PLUS_END More... | |
| void | setLength (real len, FiberEnd ref) |
| adjust length without changing the position of ref | |
| void | truncateM (unsigned int p) |
| Remove all model points in [ 0, P-1 ], keep [ P, nbPoints() ]. | |
| void | truncateP (unsigned int p) |
| Keep model points [ 0, p ], remove other points. | |
| void | write (OutputWrapper &) const |
| write to OutputWrapper | |
| void | read (InputWrapper &, Simul &) |
| read from InputWrapper More... | |
Public Member Functions inherited from PointSet | |
| PointSet () | |
| Constructor. | |
| PointSet (const PointSet &) | |
| Copy constructor. | |
| PointSet & | operator= (const PointSet &) |
| Assignement operator. | |
| virtual | ~PointSet () |
| Destructor. | |
| virtual unsigned int | allocatePoints (unsigned int nbp) |
| allocate memory to store 'nbp' points More... | |
| virtual void | deallocatePoints () |
| free memory allocated by allocatePoints() | |
| unsigned int | nbPoints () const |
| Number of points. | |
| unsigned int | lastPoint () const |
| Index of the last point = nbPoints - 1. | |
| unsigned int | nbSegments () const |
| Number of segments = nbPoints - 1. | |
| unsigned int | lastSegment () const |
| Index of the last segment = nbPoints - 2. | |
| Vector | posP (const unsigned p) const |
| Position of point 'p' of the object. | |
| real const * | addr () const |
| Address of point p. | |
| real const * | addrPoint (const unsigned p) const |
| Address of point p. | |
| void | setPoint (unsigned p, Vector const &w) |
| Set position of point p to w. | |
| void | nbPoints (const unsigned n) |
| Set the number of points in the array. | |
| unsigned int | addPoint (Vector const &w) |
| Add a point, returning the array index that was used. | |
| void | removePoint (unsigned int p) |
| Remove a point from the array psPos, returns number of points remaining. | |
| void | clearPoints () |
| Remove all points. | |
| void | resetPoints () |
| Set all coordinates to zero (nicer for debug/testing) | |
| void | addNoise (real amount) |
| Add random noise uniformly to all coordinate (used for testing purposes) | |
| virtual void | putPoints (real *) const |
| copy current coordinates to argument | |
| virtual void | getForces (const real *ptr) |
| replace current forces by the ones provided | |
| Vector | netForceP (const unsigned p) const |
| Force on point p calculate by Brownian dynamics. | |
| void | movePoint (const unsigned int p, Vector const &w) |
| Shift point at index p by vector w. | |
| Vector | diffPoints (const unsigned p) const |
| Difference of two points = Q - P = vector PQ. | |
| Vector | diffPoints (const unsigned int p, const unsigned int q) const |
| Difference of two points = Q - P = vector PQ. | |
| Vector | interpolatePoints (const unsigned int p, const unsigned int q, const real a) const |
| Calculate intermediate position = P + a ( Q - P ) | |
| void | calculateMomentum (real[], bool divide=false) |
| calculate first momentum of point coordinates More... | |
| void | calculateMomentum (real[], real[], bool divide=false) |
| calculate first and second momentum of point coordinates More... | |
| virtual Vector | position () const |
| Position of center of gravity. More... | |
| virtual bool | translatable () const |
| true if object accepts translations | |
| virtual void | translate (Vector const &) |
| Translate object (moves all the points by w) | |
| virtual bool | rotatable () const |
| true if object accepts translations | |
| virtual void | rotate (Rotation const &) |
| Rotate object by given rotation. | |
| virtual void | foldPosition (const Modulo *) |
| Modulo around the first point. | |
| virtual void | foldPositionG (const Modulo *) |
| Call modulo around the center of gravity. | |
| void | write (OutputWrapper &) const |
| Write to file. | |
| void | read (InputWrapper &, Simul &) |
| Read from file. | |
Public Member Functions inherited from Mecable | |
| Mecable () | |
| The constructor resets the pointers. | |
| virtual | ~Mecable () |
| Destructor de-allocates memory. | |
| virtual Vector | posP (unsigned int P) const =0 |
| return position of point P | |
| virtual void | putPoints (real[]) const =0 |
| copy current coordinates to provided array | |
| virtual void | getPoints (const real[])=0 |
| replace current coordinates of points by values from the provided array | |
| virtual Vector | netForceP (unsigned int p) const =0 |
| return Force on point p calculated at previous step by Brownian dynamics | |
| virtual void | getForces (const real[])=0 |
| replace current forces by the ones provided | |
| void | matIndex (Matrix::index_type index) |
| Store the index where coordinates are located in Meca. | |
| Matrix::index_type | matIndex () const |
| Index in mB of the first point. the index in the vectors is DIM*matIndex() More... | |
| bool | useBlock () const |
| Tell Meca to use preconditionning on this object or not. | |
| void | useBlock (bool b) |
| change preconditionning flag | |
| real * | allocateBlock (unsigned) |
| Allocate a block of the requested size. | |
| real * | block () const |
| return allocated block | |
| virtual void | setDragCoefficient ()=0 |
| Calculate the mobility coefficient. | |
| virtual real | dragCoefficient () const =0 |
| The total drag coefficient of object ( force = drag * speed ) | |
| virtual void | prepareMecable ()=0 |
| prepare the Mecable to solve the mechanics in Meca::solve() More... | |
| virtual real | addBrownianForces (real *rhs, real sc) const |
| Add Brownian noise terms to a force vector (sc = kT / dt) | |
| virtual void | addRigidity (const real *X, real *Y) const |
| Add rigidity terms Y <- Y + Rigidity * X. More... | |
| virtual void | addRigidityMatUp (Matrix &mB, int offset) const |
| Add rigidity matrix elements (which should be symmetric) to provided matrix. More... | |
| virtual void | setSpeedsFromForces (const real *X, real *Y, real sc=1.0, bool rhs=false) const =0 |
| Calculate speeds from given forces. More... | |
| virtual void | makeProjectionDiff (const real *forces) |
| set the terms obtained from the linearization of the Projection operator, from the given forces More... | |
| virtual void | addProjectionDiff (const real *X, real *Y) const |
| add terms from projection correction terms: Y <- Y + P' * X; More... | |
| virtual void | setInteractions (Meca &) const |
| add the interactions (for example due to confinements) | |
Public Member Functions inherited from Object | |
| Object () | |
| constructor | |
| virtual Tag | tag () const =0 |
| an ASCII character identifying the ObjectSet corresponding to this object | |
| virtual const Property * | property () const =0 |
| Property associated with the Object. | |
| std::string | reference () const |
| concatenation of [ tag(), property()->index(), number() ] in plain ascii More... | |
| void | writeReference (OutputWrapper &) const |
| write a reference that identifies the Object uniquely More... | |
| void | writeReference (OutputWrapper &, Tag tag) const |
| write a reference, but using the provided Tag More... | |
| int | mark () const |
| birth mark value | |
| void | mark (int m) |
| set birth mark | |
| int | fleck () const |
| fleck value (not stored in trajectory files) | |
| void | fleck (int f) const |
| set fleck (the value is not stored in trajectory files) | |
| Object * | next () const |
| extends Node::next(), with a cast to preserve type | |
| Object * | prev () const |
| extends Node::prev(), with a cast to preserve type | |
Public Member Functions inherited from Node | |
| Node () | |
| constructor set as unlinked | |
| virtual | ~Node () |
| destructor More... | |
| bool | linked () const |
| true if Node is linked | |
| Node * | next () const |
| the next Node in the list, or zero if this is last | |
| Node * | prev () const |
| the previous Node in the list, or zero if this is first | |
| NodeList * | list () const |
| the list where the object is linked, or zero | |
| ObjectSet * | objset () const |
| return associated ObjectSet | |
Public Member Functions inherited from Inventoried | |
| Inventoried () | |
| initialize (name=0) | |
| ~Inventoried () | |
| destructor | |
| void | number (Number n) |
| change the serial number | |
| Number | number () const |
| serial number : a integer identifier, unique within each class | |
Public Member Functions inherited from Movable | |
| Movable () | |
| constructor | |
| virtual | ~Movable () |
| destructor | |
| virtual void | setPosition (Vector const &) |
| move object to specified position More... | |
| virtual void | rotateP (Rotation const &) |
| rotate the object around its current position More... | |
Public Member Functions inherited from Buddy | |
| virtual | ~Buddy () |
| upon destruction, goodbye is called for all buddies | |
| void | hello (Buddy *b) |
| will make this and b mutual buddies | |
| virtual void | goodbye (Buddy *) |
| this is called everytime a known buddy is destroyed | |
| Buddy * | buddy (unsigned int ix) const |
| return buddy at index ix | |
| void | buddy (Buddy *b, unsigned int ix) |
| replace the buddy that may have been at index ix | |
Protected Member Functions | |
| virtual void | updateRange ()=0 |
| callback for function that elongates or shorten the Fiber | |
Additional Inherited Members | |
Static Public Member Functions inherited from PointSet | |
| static Vector | diffPoints (const real *src, const unsigned p) |
| Difference of two points = P+1 - P. | |
Static Public Member Functions inherited from Object | |
| static std::string | strReference (char, int, Number, int) |
| build a string reference by concatenating (tag, property_index, number, mark) More... | |
| static void | readReference (InputWrapper &, int &, Number &, int &, char pretag) |
| read a reference (property_index, number, mark) from input More... | |
| static void | writeNullReference (OutputWrapper &) |
| write a reference that does not refer to any Object | |
Static Public Member Functions inherited from Movable | |
| static Vector | readPrimitive (std::istream &, const Space *) |
| read a position specified with primitives, such as 'circle 5', etc. More... | |
| static Vector | readPosition (std::istream &, const Space *) |
| read a position in space More... | |
| static Vector | readDirection (std::istream &, const Vector &, const Space *) |
| read an orientation, and return a normalized vector More... | |
| static Rotation | readRotation (std::istream &, const Vector &, const Space *) |
| read a rotation specified in is, at position pos More... | |
Static Public Attributes inherited from Object | |
| static const Tag | TAG = 'v' |
| Object::TAG = 'v' represents the 'void' pointer. | |
Protected Attributes inherited from PointSet | |
| real * | psPos |
| psPos[] of size DIM*psAllocated contains DIM*psSize point-coordinates | |
| real const * | psFor |
| psFor[] of size DIM*psAllocated contains DIM*psSize force-coordinates | |
| Vector | psCenter |
| Center of gravity calculed in calculatePosition() | |
Protected Attributes inherited from Node | |
| Node * | nNext |
| the next Node in the list | |
| Node * | nPrev |
| the previous Node in the list | |
Protected Attributes inherited from Inventoried | |
| Number | nNumber |
| object identifier, unique within the class defined by tag() | |
convert the abscissa that is specified from the given end, to the abscissa from the ORIGIN.
ATTENTION: the direction is inverted when from = PLUS_END
| void addSegmentM | ( | ) |
This extends the fiber by adding one segment at the MINUS_END. Thus segmentation() is not changed, and the existing points are not displaced.
| void addSegmentP | ( | ) |
This extends the fiber by adding one segment at the PLUS_END. Thus segmentation() is not changed, and the existing points are not displaced.
| void adjustSegmentation | ( | ) |
A fiber is segmented as a function of its length.
The number of segments will be such that:
| void cutM | ( | real | dlen | ) |
The Fiber length is reduced by dlen ( which must be >= 0 ). The portion of size dlen near the MINUS_END is removed, the (fewer) model-points are recalculated.
Note: after cutM(), the distance between the points is not equal to segmentation(). This is true only if the fiber is straight.
| void cutP | ( | real | dlen | ) |
The Fiber length is reduced by dlen ( which must be >= 0 ). The portion of size dlen near the PLUS_END is removed, the (fewer) model-points are recalculated.
Note: after cutP(), the distance between the points is not equal to segmentation(). This is true only if the fiber is straight.
|
inline |
We divide by fnCut, which should be the distance between points
| void growM | ( | real | dlen | ) |
The argument 'dlen' can be positive or negative:
Note: This works nicely only if dlen is small compared to segmentation(). For large decrease in length, use cutM().
| void growP | ( | real | dlen | ) |
The argument 'dlen' can be positive or negative:
Note: This works nicely only if dlen is small compared to segmentation(). For large decrease in length, use cutP().
Returns the average and variances of segment length
| PointInterpolated interpolate | ( | real | ab | ) | const |
Convert abscissa `ab' into a PointInterpolated = ( a model-point `r' + a coefficient `a' ). The corresponding point X = P(r) * (1-a) + P(r+1) * a:
In this function, the abscissa ab is taken from the ORIGIN of the Fiber.
| PointInterpolated interpolateM | ( | real | ab | ) | const |
Same as interpolate(), but the abscissa `ab' is taken from the MINUS_END of the Fiber.
| void join | ( | FiberNaked const * | fib | ) |
The model-point are reinterpolated linearly, and the length of the segments will not fullfil the constraints of segmentation. If this is a problem, FiberNaked::reshape() should be called.
fib should generally be destroyed afterward.
Returns the minimum and maximum distance between consecutive points
| unsigned nbKinks | ( | real | threshold = 0 | ) | const |
Returns the minimum and maximum distance between consecutive points
The returned value is negative when the force antagonizes elongation, and this is true at both ends.
|
virtual |
The fiber will be re-segmented if its current desired segmentation does not match the one stored in the file.
Implements Object.
Reimplemented in DynamicFiber, Tubule, ClassicFiber, and TreadmillingFiber.
| void resegment | ( | unsigned int | nb_points | ) |
Note: Unless the Fiber is straight, the segments will not be exactly of length fnCut after the reinterpolation, and calling reshape() may be necessary.
| void setShape | ( | const real | pts[], |
| unsigned | n_pts, | ||
| unsigned | np | ||
| ) |
This will set the Fiber with n points, unless ( n == 0 ) in which case the number of points will be set automatically from fnCutWished. pts[] should be of size DIM * n_pts.
The given set of points do not need to be equally distributed. The length of the fiber will be roughly equal to the sum of all segment lengths. The MINUS_END and PLUS_END will be set to the first and last points provided, and intermediate points will be set by interpolating pts[].
The length of the segments will only be approximately equal, and reshape() should be called to equalize them if necessary
The Fiber is partitionned by this function in three regions:
A Fiber shorter than 2*len does not have a central region, and is composed of PLUS_END and MINUS_END parts of equal size.